-- GENERATED SPELL FOR [Astromancer Lord] --


function spell0_20046(pUnit, Event) --@Dragon\'s Breath,Self--
pUnit:FullCastSpellOnTarget(37289,pUnit)
pUnit:RegisterEvent('Sorts_20046', 3254, 1)
end

function spell1_20046(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(37110,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20046', 583, 1)
end

function spell2_20046(pUnit, Event) --@Fire Shield,n/a--
pUnit:FullCastSpellOnTarget(38732,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20046', 0, 1)
end

function spell3_20046(pUnit, Event) --@Fireball Volley,n/a--
pUnit:FullCastSpellOnTarget(37109,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20046', 610, 1)
end

function Sorts_20046(pUnit, Event)
local choix_sorts_20046 = math.random(0, 3)
if choix_sorts_20046 == 0 then
pUnit:RegisterEvent('spell0_20046', 1, 1)
end
if choix_sorts_20046 == 1 then
pUnit:RegisterEvent('spell1_20046', 1, 1)
end
if choix_sorts_20046 == 2 then
pUnit:RegisterEvent('spell2_20046', 1, 1)
end
if choix_sorts_20046 == 3 then
pUnit:RegisterEvent('spell3_20046', 1, 1)
end
end

function mob20046_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20046', math.random(1500, 3000), 1)
end

function mob20046_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20046_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20046_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20046, 1, 'mob20046_Action')
RegisterUnitEvent(20046, 2, 'mob20046_Leave')
RegisterUnitEvent(20046, 3, 'mob20046_Kill')
RegisterUnitEvent(20046, 4, 'mob20046_Die')
